import React, { PureComponent } from 'react'
import { withRouter } from "react-router-dom";
import style from "./index.module.scss"
import { Swiper } from 'antd-mobile'
 class index extends PureComponent {
 componentDidMount(){
  console.log('this.propscomponentDidMount',this.props);
 }
  render() {
    console.log('this.propsrender',this.props.data1);
    return (
      <div>
        <h1>Banner</h1>
        <Swiper
            loop
            autoplay
            indicatorProps={{
              color: 'white',
            }}
            defaultIndex={0}
            className={style.Swiper}
          >
            {this.props.data1.map((item, index) => 
            {
              return (
                (
                  <Swiper.Item key={index+1}>
                   { <img src={item} />}
                  </Swiper.Item>
                )
              )
            }
            )}
          </Swiper>
      </div>
    )
  }
}
export default withRouter(index)